3.1.84 \(\int \frac {(a+b x)^2 (A+B x)}{x^3} \, dx\)

Optimal. Leaf size=44 \[ -\frac {a^2 A}{2 x^2}-\frac {a (a B+2 A b)}{x}+b \log (x) (2 a B+A b)+b^2 B x \]

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {76} \begin {gather*} -\frac {a^2 A}{2 x^2}-\frac {a (a B+2 A b)}{x}+b \log (x) (2 a B+A b)+b^2 B x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + b*x)^2*(A + B*x))/x^3,x]

[Out]

-(a^2*A)/(2*x^2) - (a*(2*A*b + a*B))/x + b^2*B*x + b*(A*b + 2*a*B)*Log[x]

Rule 76

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps

\begin {align*} \int \frac {(a+b x)^2 (A+B x)}{x^3} \, dx &=\int \left (b^2 B+\frac {a^2 A}{x^3}+\frac {a (2 A b+a B)}{x^2}+\frac {b (A b+2 a B)}{x}\right ) \, dx\\ &=-\frac {a^2 A}{2 x^2}-\frac {a (2 A b+a B)}{x}+b^2 B x+b (A b+2 a B) \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 43, normalized size = 0.98 \begin {gather*} -\frac {a^2 (A+2 B x)}{2 x^2}+b \log (x) (2 a B+A b)-\frac {2 a A b}{x}+b^2 B x \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)^2*(A + B*x))/x^3,x]

[Out]

(-2*a*A*b)/x + b^2*B*x - (a^2*(A + 2*B*x))/(2*x^2) + b*(A*b + 2*a*B)*Log[x]

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(a+b x)^2 (A+B x)}{x^3} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[((a + b*x)^2*(A + B*x))/x^3,x]

[Out]

IntegrateAlgebraic[((a + b*x)^2*(A + B*x))/x^3, x]

________________________________________________________________________________________

fricas [A]  time = 1.42, size = 53, normalized size = 1.20 \begin {gather*} \frac {2 \, B b^{2} x^{3} + 2 \, {\left (2 \, B a b + A b^{2}\right )} x^{2} \log \relax (x) - A a^{2} - 2 \, {\left (B a^{2} + 2 \, A a b\right )} x}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x^3,x, algorithm="fricas")

[Out]

1/2*(2*B*b^2*x^3 + 2*(2*B*a*b + A*b^2)*x^2*log(x) - A*a^2 - 2*(B*a^2 + 2*A*a*b)*x)/x^2

________________________________________________________________________________________

giac [A]  time = 1.19, size = 47, normalized size = 1.07 \begin {gather*} B b^{2} x + {\left (2 \, B a b + A b^{2}\right )} \log \left ({\left | x \right |}\right ) - \frac {A a^{2} + 2 \, {\left (B a^{2} + 2 \, A a b\right )} x}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x^3,x, algorithm="giac")

[Out]

B*b^2*x + (2*B*a*b + A*b^2)*log(abs(x)) - 1/2*(A*a^2 + 2*(B*a^2 + 2*A*a*b)*x)/x^2

________________________________________________________________________________________

maple [A]  time = 0.01, size = 48, normalized size = 1.09 \begin {gather*} A \,b^{2} \ln \relax (x )+2 B a b \ln \relax (x )+B \,b^{2} x -\frac {2 A a b}{x}-\frac {B \,a^{2}}{x}-\frac {A \,a^{2}}{2 x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^2*(B*x+A)/x^3,x)

[Out]

b^2*B*x-2*a/x*A*b-a^2/x*B+A*ln(x)*b^2+2*B*ln(x)*a*b-1/2*a^2*A/x^2

________________________________________________________________________________________

maxima [A]  time = 0.93, size = 46, normalized size = 1.05 \begin {gather*} B b^{2} x + {\left (2 \, B a b + A b^{2}\right )} \log \relax (x) - \frac {A a^{2} + 2 \, {\left (B a^{2} + 2 \, A a b\right )} x}{2 \, x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x^3,x, algorithm="maxima")

[Out]

B*b^2*x + (2*B*a*b + A*b^2)*log(x) - 1/2*(A*a^2 + 2*(B*a^2 + 2*A*a*b)*x)/x^2

________________________________________________________________________________________

mupad [B]  time = 0.06, size = 46, normalized size = 1.05 \begin {gather*} \ln \relax (x)\,\left (A\,b^2+2\,B\,a\,b\right )-\frac {\frac {A\,a^2}{2}+x\,\left (B\,a^2+2\,A\,b\,a\right )}{x^2}+B\,b^2\,x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x)^2)/x^3,x)

[Out]

log(x)*(A*b^2 + 2*B*a*b) - ((A*a^2)/2 + x*(B*a^2 + 2*A*a*b))/x^2 + B*b^2*x

________________________________________________________________________________________

sympy [A]  time = 0.49, size = 46, normalized size = 1.05 \begin {gather*} B b^{2} x + b \left (A b + 2 B a\right ) \log {\relax (x )} + \frac {- A a^{2} + x \left (- 4 A a b - 2 B a^{2}\right )}{2 x^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**2*(B*x+A)/x**3,x)

[Out]

B*b**2*x + b*(A*b + 2*B*a)*log(x) + (-A*a**2 + x*(-4*A*a*b - 2*B*a**2))/(2*x**2)

________________________________________________________________________________________